<template>
  <div class="home">
    <van-nav-bar title="列表" />
    <van-button
      type="primary"
      class="btn"
      round
      block
      @click="$router.push('/about')"
      >添加列表</van-button
    >
    <my-list
      v-for="item in list"
      :key="item.id"
      :item="item"
      @click.native="$router.push({ path: '/about', query: { id: item.id } })"
    ></my-list>
  </div>
</template>

<script>
// @ is an alias to /src
import myList from "@/components/myList.vue";

export default {
  name: "HomeView",
  components: {
    myList,
  },
  computed: {
    list() {
      return this.$store.state.list;
    },
  },
};
</script>
<style lang="scss" scoped>
.btn {
  position: fixed;
  bottom: 0;
  left: 0;
}
</style>
